inherited frmSetMetersIndications: TfrmSetMetersIndications
  Left = 377
  Top = 205
  Width = 760
  Height = 521
  ActiveControl = dbgMeterList
  AutoSize = True
  BorderIcons = [biSystemMenu]
  Caption = #1047#1072#1085#1077#1089#1077#1085#1080#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1081' '#1087#1086' '#1089#1095#1077#1090#1095#1080#1082#1072#1084
  Constraints.MaxHeight = 750
  Constraints.MaxWidth = 1000
  Constraints.MinHeight = 400
  Constraints.MinWidth = 600
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    Top = 467
    Width = 752
    Align = alTop
    inherited BitBtn1: TBitBtn
      Left = 548
    end
    inherited BitBtn2: TBitBtn
      Left = 650
    end
  end
  inherited ToolBar1: TToolBar
    Top = 494
    Width = 752
    Height = 0
    Enabled = False
    inherited ToolButton1: TToolButton
      Enabled = False
    end
    inherited ToolButton2: TToolButton
      Enabled = False
    end
    inherited ToolButton3: TToolButton
      Enabled = False
    end
    inherited ToolButton4: TToolButton
      Enabled = False
    end
  end
  object GroupBox: TGroupBox [2]
    Left = 0
    Top = 0
    Width = 752
    Height = 467
    Align = alTop
    Caption = ' '#1057#1095#1077#1090#1095#1080#1082#1080' '#1072#1073#1086#1085#1077#1085#1090#1072' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    ParentFont = False
    TabOrder = 2
    object dbgMeterList: TDBGridEh
      Left = 2
      Top = 15
      Width = 748
      Height = 385
      Align = alClient
      AllowedOperations = [alopUpdateEh]
      AllowedSelections = [gstRecordBookmarks, gstRectangle, gstColumns]
      DataGrouping.GroupLevels = <>
      DataSource = dsc_MeterList
      EditActions = [geaDeleteEh]
      Flat = True
      FooterColor = clWindow
      FooterFont.Charset = DEFAULT_CHARSET
      FooterFont.Color = clWindowText
      FooterFont.Height = -11
      FooterFont.Name = 'MS Sans Serif'
      FooterFont.Style = []
      MinAutoFitWidth = 10
      Options = [dgEditing, dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
      OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghFitRowHeightToText, dghEnterAsTab, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
      RowDetailPanel.Color = clBtnFace
      RowHeight = 2
      RowLines = 1
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      UseMultiTitle = True
      VTitleMargin = 5
      OnColEnter = dbgMeterListColEnter
      OnColExit = dbgMeterListColExit
      OnEnter = dbgMeterListEnter
      OnKeyUp = dbgMeterListKeyUp
      Columns = <
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'SERVICE'
          Footers = <>
          Width = 204
        end
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'METER_NUM'
          Footers = <>
          Width = 77
        end
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'NAME'
          Footers = <>
          Width = 79
        end
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'CURR_IND'
          Footers = <>
          Width = 65
        end
        item
          EditButtons = <>
          FieldName = 'NEW_PH'
          Footers = <>
          Width = 70
        end
        item
          EditButtons = <>
          FieldName = 'NEW_ZERO'
          Footers = <>
          Width = 66
        end
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'POTR'
          Footers = <>
          Width = 77
        end
        item
          Color = clInactiveCaptionText
          EditButtons = <>
          FieldName = 'RDATE'
          Footers = <>
          Title.Caption = #1044#1072#1090#1072' '#1090#1077#1082#1091#1097#1080#1093' '#1087#1086#1082#1072#1079#1072#1085#1080#1081
        end>
      object RowDetailData: TRowDetailPanelControlEh
      end
    end
    object GroupBox1: TGroupBox
      Left = 2
      Top = 400
      Width = 748
      Height = 65
      Align = alBottom
      Caption = ' '#1055#1072#1088#1072#1084#1077#1090#1088#1099' '
      TabOrder = 1
      object Label1: TLabel
        Left = 40
        Top = 28
        Width = 121
        Height = 13
        Caption = #1044#1072#1090#1072' '#1089#1085#1103#1090#1080#1103' '#1087#1086#1082#1072#1079#1072#1085#1080#1081
      end
      object Label2: TLabel
        Left = 320
        Top = 28
        Width = 88
        Height = 13
        Caption = #1044#1072#1090#1072' '#1085#1072#1095#1080#1089#1083#1077#1085#1080#1103
      end
      object dbtEdate: TDBDateTimeEditEh
        Left = 172
        Top = 25
        Width = 121
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 0
        Visible = True
      end
      object dbtChargeDate: TDBDateTimeEditEh
        Left = 420
        Top = 25
        Width = 121
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 1
        Visible = True
      end
    end
  end
  inherited ActionList1: TActionList
    inherited aSave: TAction
      OnExecute = aSaveExecute
    end
    inherited aCancel: TAction
      OnExecute = aCancelExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'frmSetMetersIndications'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.PixelsPerInch'
      '<P>.Width'
      'GroupBox.dbgMeterList.<P>.Columns.<ForAllItems>.Width')
  end
  object dsc_MeterList: TDataSource
    DataSet = mte_MeterList
    Left = 380
    Top = 136
  end
  object ds_MeterList: TpFIBDataSet
    SelectSQL.Strings = (
      'select s.name as service, m.meter_num, m.name, m.id,'
      
        '       (select rph from proc_meter_get_ind (m.id, current_date, ' +
        'null)) as curr_ind,'
      
        '       (select rdate from proc_meter_get_ind (m.id, current_date' +
        ', null)) as rdate,'
      '       cast(null as numeric(15, 4)) as new_ph,'
      '       cast(0 as integer) as new_zero,'
      '       mt.capacity,'
      '       d.id as dogovor_id,'
      '       m.accpoint_id'
      '  from abonents a'
      '  join vw_dogovors d on d.abonent_id = a.id'
      '    and d.is_active = 1'
      
        '  left join proc_dogovor_get_meters (d.id, current_date, null, n' +
        'ull) p on p.rstatus > 0'
      '  join meters m on m.id = p.rmeter_id'
      '  join meter_types mt on mt.id = m.meter_type'
      '  join services s on s.id = d.service_id'
      '  where a.id = :pabonent_id'
      'order by 1, m.accpoint_id, 2')
    Transaction = LocalTrans
    Database = MAINDM.pMainDatabase
    UpdateTransaction = UpdateTrans
    Left = 316
    Top = 136
    object ds_MeterListSERVICE: TFIBStringField
      DisplayLabel = #1059#1089#1083#1091#1075#1072
      DisplayWidth = 25
      FieldName = 'SERVICE'
      Size = 120
      EmptyStrToNull = True
    end
    object ds_MeterListMETER_NUM: TFIBStringField
      DisplayLabel = #8470' '#1089#1095#1077#1090#1095#1080#1082#1072
      DisplayWidth = 10
      FieldName = 'METER_NUM'
      EmptyStrToNull = True
    end
    object ds_MeterListNAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077' '#1089#1095#1077#1090#1095#1080#1082#1072
      DisplayWidth = 15
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object ds_MeterListID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_MeterListCURR_IND: TFIBBCDField
      DisplayLabel = #1058#1077#1082#1091#1097#1080#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103
      FieldName = 'CURR_IND'
      Size = 3
      RoundByScale = True
    end
    object ds_MeterListNEW_PH: TFIBBCDField
      DisplayLabel = #1053#1086#1074#1099#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103
      FieldName = 'NEW_PH'
      Size = 4
      RoundByScale = True
    end
    object ds_MeterListNEW_ZERO: TFIBIntegerField
      DisplayLabel = #1055#1077#1088#1077#1093#1086#1076#1086#1074' '#1095#1077#1088#1077#1079' 0'
      FieldName = 'NEW_ZERO'
    end
    object ds_MeterListRDATE: TFIBDateField
      FieldName = 'RDATE'
    end
    object ds_MeterListDOGOVOR_ID: TFIBIntegerField
      FieldName = 'DOGOVOR_ID'
    end
    object ds_MeterListCAPACITY: TFIBIntegerField
      FieldName = 'CAPACITY'
    end
    object ds_MeterListACCPOINT_ID: TFIBIntegerField
      FieldName = 'ACCPOINT_ID'
    end
  end
  object LocalTrans: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 288
    Top = 136
  end
  object UpdateTrans: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 288
    Top = 164
  end
  object mte_MeterList: TMemTableEh
    Tag = 1
    AutoCalcFields = False
    CachedUpdates = True
    Params = <>
    BeforeScroll = mte_MeterListBeforeScroll
    AfterScroll = mte_MeterListAfterScroll
    OnCalcFields = mte_MeterListCalcFields
    Left = 348
    Top = 136
    object mte_MeterListSERVICE: TStringField
      DisplayLabel = #1059#1089#1083#1091#1075#1072
      DisplayWidth = 25
      FieldName = 'SERVICE'
      ReadOnly = True
      Size = 120
    end
    object mte_MeterListMETER_NUM: TStringField
      DisplayLabel = #8470' '#1089#1095#1077#1090#1095#1080#1082#1072
      DisplayWidth = 10
      FieldName = 'METER_NUM'
      ReadOnly = True
    end
    object mte_MeterListNAME: TStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077' '#1089#1095#1077#1090#1095#1080#1082#1072
      DisplayWidth = 15
      FieldName = 'NAME'
      ReadOnly = True
      Size = 60
    end
    object mte_MeterListID: TIntegerField
      FieldName = 'ID'
      ReadOnly = True
    end
    object mte_MeterListCURR_IND: TBCDField
      DisplayLabel = #1058#1077#1082#1091#1097#1080#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103
      FieldName = 'CURR_IND'
      ReadOnly = True
      Size = 0
    end
    object mte_MeterListNEW_PH: TBCDField
      DisplayLabel = #1053#1086#1074#1099#1077' '#1087#1086#1082#1072#1079#1072#1085#1080#1103
      DisplayWidth = 10
      FieldName = 'NEW_PH'
      Size = 0
    end
    object mte_MeterListNEW_ZERO: TIntegerField
      DisplayLabel = #1055#1077#1088#1077#1093#1086#1076#1086#1074' '#1095#1077#1088#1077#1079' 0'
      FieldName = 'NEW_ZERO'
      MaxValue = 2
    end
    object mte_MeterListPOTR: TBCDField
      DisplayLabel = #1055#1086#1090#1088#1077#1073#1083#1077#1085#1080#1077
      FieldKind = fkCalculated
      FieldName = 'POTR'
      ReadOnly = True
      Size = 0
      Calculated = True
    end
    object mte_MeterListRDATE: TDateField
      FieldName = 'RDATE'
      ReadOnly = True
    end
    object mte_MeterListDOGOVOR_ID: TIntegerField
      FieldName = 'DOGOVOR_ID'
    end
    object mte_MeterListCAPACITY: TIntegerField
      FieldName = 'CAPACITY'
    end
    object mte_MeterListACCPOINT_ID: TIntegerField
      FieldName = 'ACCPOINT_ID'
    end
  end
  object qCharge: TpFIBQuery
    Transaction = UpdateTrans
    Database = MAINDM.pMainDatabase
    SQL.Strings = (
      'SELECT'
      '    RACT_ID,'
      '    RGROUP_ID,'
      '    RBASE_SUMMA,'
      '    RSUMMA,'
      '    RSUMMA_EX,'
      '    RCOUNT'
      'FROM'
      '    PROC_GEN_CHARGE_METER(:PACT_ID,'
      '    :PDOCDATE, 1) ')
    Left = 316
    Top = 164
    qoStartTransaction = True
  end
  object qNewAct: TpFIBQuery
    Transaction = UpdateTrans
    Database = MAINDM.pMainDatabase
    SQL.Strings = (
      'SELECT'
      '    RACT_ID'
      'FROM'
      '    PROC_METER_NEW_ACT(:PACCPOINT_ID,'
      '    :PDOCDATE,'
      '    :PDOCDATE,'
      '    :PMETER_STR,'
      '    :PMETER_PH_STR,'
      '    :PMETER_ZERO_STR) ')
    Left = 316
    Top = 196
    qoStartTransaction = True
  end
end
